<%@ page language="java"  pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>专业研究</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
<LINK href="resource/css/admin.css" type="text/css" rel="stylesheet">

	 <script type="text/javascript">
	    function  addcheck(){
	       var  code=document.getElementById("category").value;
            if(code=="0"){
               alert("请选择添加类别");
               return false;
            }
            var  title=document.getElementById("title").value;
            if(title==""){
               alert("请填写添加的标题");
               return false;
            }
            return true;
	    }
	      function   showPic(){
	       var searchid=document.getElementById("searchid").value;
	       if( searchid!=""){
	          document.getElementById("picspan").style.display="inline";
	       }
	    }
	 </script>
  </head>
  
  <body onload="showPic()">
    <s:if test="#list.size()==0">
           <center> 请先添加行业视点类别</center>
       </s:if>
    <s:else>
    <div align="center">
      <form  method="post" action="<%=basePath%>pro/addReSearch.shtml"  enctype="multipart/form-data" onsubmit="return addcheck()">
      <table align="center">
      <input type="hidden" name="id" value="${search.id}" id="searchid"/>
      <tr>
         <td>请选择类别</td><td><select name="search.categoryId" id="category"><option value="0">请选择分类</option>
            <s:iterator id="pro" value="list">
             <option value="${pro.id}"  ${search.categoryId eq pro.id?'selected' :''}>${pro.title}</option>
            </s:iterator>
         </select></td>
         
      </tr>
      <tr>
         <td>
           请填写标题：
         </td>
         <td>
           <input type="text" name="search.title" id="title" value="${search.title}"/>
         </td>
      </tr>               
         <tr>
         <td>
          上传附件：
         </td>
         <td>
           <input type="file" name="file" id="pic"/>&nbsp;&nbsp;<span id="picspan" style="display:none">原来的附件:<img align="middle" src="<%=basePath%>${search.attachUrl}" height="60px;" width="60px;"/></span>
         </td>
      </tr>
           <tr><td align="center" colspan="2"><input type="submit" value="保存" />&nbsp;&nbsp;<input type="reset" value="重置"></td></tr>
      </table>
      </form>
      </s:else>
  </body>
</html>
